﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using Shove.Web.UI;

public partial class UserControls_HotComment : UCBase
{
    public UserControls_HotComment()
    {
        Name = "热门评论";

        swpas = new ShoveWebPartAttribute[3];

        swpas[0] = new ShoveWebPartAttribute_Int("显示的行数", "1,40", 4, "显示的行数");
        swpas[1] = new ShoveWebPartAttribute_Int("控件宽度", "1,1004", 203, "控件宽度");
        swpas[2] = new ShoveWebPartAttribute_Int("控件高度", "1,1004", 400, "控件高度");
    }

    private void Initlayout()
    {
        tabctr.Width = swpAttributes[1];
        tabctr.Height = swpAttributes[2];
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        Initlayout();
        BindData();
    }

    private void BindData()
    {
        int Count = Shove._Convert.StrToInt(swpAttributes[0], 4);

        DataTable dt = new DAL.Views.V_Site_GoodComment().Open("top " + Count + " * ", "", "");

        if (dt != null && dt.Rows.Count > 0)
        {
            rpCommentPro.DataSource = dt;
            rpCommentPro.DataBind();
        }
    }

}
